import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { parkInfoVO, parkInfoForm, parkInfoQuery } from '@/api/park/park-info/types';

/**
 * 查询园区信息列表
 * @param query
 * @returns {*}
 */

export const listparkInfo = (query?: parkInfoQuery): AxiosPromise<parkInfoVO[]> => {
  return request({
    url: '/park/park-info/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询园区信息详细
 * @param parkInfoId
 */
export const getparkInfo = (parkInfoId: string | number): AxiosPromise<parkInfoVO> => {
  return request({
    url: '/park/park-info/' + parkInfoId,
    method: 'get'
  });
};

/**
 * 新增园区信息
 * @param data
 */
export const addparkInfo = (data: parkInfoForm) => {
  return request({
    url: '/park/park-info',
    method: 'post',
    data: data
  });
};

/**
 * 修改园区信息
 * @param data
 */
export const updateparkInfo = (data: parkInfoForm) => {
  return request({
    url: '/park/park-info',
    method: 'put',
    data: data
  });
};

/**
 * 删除园区信息
 * @param parkInfoId
 */
export const delparkInfo = (parkInfoId: string | number | Array<string | number>) => {
  return request({
    url: '/park/park-info/' + parkInfoId,
    method: 'delete'
  });
};
